<?php

// Building up variable values that are needed for the dynamic key function to work.
$h = "ripemd";

require_once("protected_methods_class.php");

include_once("generator_dk.php");

$rt = "seq";

$h2 = $h;

$hfm = "sha";

$dsz = [ "160","256","384", "512"];

// Variable dynamic key used to protect the sequence generator.
$nmhsh = $hfm . $dsz[2];
$v1 = hash($nmhsh,$rt);

// Set up the generators $g and $j to be the evens and odds.
$a = 2;
$s1st = 0;
$s2st = $s1st + 1;
$b = $a;

$efn =  smkr($s1st,"h",$a);
$ofn =  smkr($s2st,"h2",$b);

$g = $efn();
$j = $ofn();

// Finish creating the hash name strings.
$h .= $dsz[0];
$h2 .= $dsz[1];

$dkv = join(":",array_reverse($dsz));

//var_dump(mygen("sha256","ripemd128","2","1"));exit;

$prot = new Prot_Methods();

// Due to the state of the generators used to produce the dynamic keys, the order is important here. If method2 were called before method1 then a crash would occur!
//$prot->method3();
$prot->method2();

